﻿using MetroGS.Properties;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace MetroGS.Pages
{
    /// <summary>
    /// Interaction logic for UCEdit.xaml
    /// </summary>
    public partial class UCEdit : UserControl
    {
        public UCEdit()
        {
            InitializeComponent();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Process.Start(AppDomain.CurrentDomain.BaseDirectory + "\\DataContent\\gamesdb.mdb");
        }

        private void cb_update_Checked(object sender, RoutedEventArgs e)
        {
            Settings.Default.update = "on";
            Properties.Settings.Default.Save();
        }

        private void cb_update_Unchecked(object sender, RoutedEventArgs e)
        {
            Settings.Default.update = "off";
            Properties.Settings.Default.Save();
        }

        private void uc_edit_Loaded(object sender, RoutedEventArgs e)
        {
            if (Settings.Default.update == "on")
            {
                cb_update.IsChecked = true;
            }
        }
    }
}
